package com.example.mobile2121606109ycg0509;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class login extends AppCompatActivity {

    private EditText edtTxtMainUserName;
    private EditText edtTxtMainPassword;
    private Button btnMainLogin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);
        initView();

        btnMainLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent =new Intent(login.this, ShowDateActivity.class);
                intent.putExtra("userName",edtTxtMainUserName.getText().toString().trim());
                Bundle bundle = new Bundle();
                bundle.putString("passWord",edtTxtMainPassword.getText().toString().trim());
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
    }

    private void initView() {
        edtTxtMainUserName = (EditText) findViewById(R.id.edtTxtMainUserName);
        edtTxtMainPassword = (EditText) findViewById(R.id.edtTxtMainPassword);
        btnMainLogin = (Button) findViewById(R.id.btnMainLogin);
    }
}